#include <iostream>
#include <cassert>
#include <cstring>
#include <cerrno>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define PIPE_NAME "./mypipe"

//创建命名管道
void CreateNamedPipe(const std::string& pathName)
{
    umask(0);
    int n = mkfifo(pathName.c_str(), 0600);
    
    if(n == -1)
    {
        std::cout << "errstr:" << strerror(errno) << std::endl;

    }
}

//删除管道文件
void RemovePipe(const std::string& pathName)
{
    int ret = unlink(pathName.c_str());
    assert(ret != -1);
    (void)ret;
}